/*
 脚本功能：商店
 */

var a = 0;
var icon = "#fUI/UIWindow/Quest/icon2/7#";
var ttt = "#fUI/UIWindow/Quest/icon2/7#";//"+ttt+"//美化1
var jzs2 = "#fUI/GuildMark.img/Mark/Animal/00002002/15#";//家族小兔子
var xxx = "#fEffect/CharacterEff/1082565/2/0#"; //星系
var ob1 = "#fEffect/SetEff/102/effect/7#";//PPMS鸟右
var ob2 = "#fEffect/SetEff/102/effect/7#";//PPMS鸟左
var F114 = "#fUI/NameTag.img/157/w#";//小兔子戒指头部、
var ob14 = "#fUI/UIWindow2.img/Item/timeLimit/0#";//小闹钟
var icon = "#fUI/UIWindow/Quest/icon2/7#";
var ttt = "#fUI/UIWindow/Quest/icon2/7#";//"+ttt+"//美化1
var jzs2 = "#fUI/GuildMark.img/Mark/Animal/00002002/15#";//家族小兔子
var xxx = "#fEffect/CharacterEff/1082565/2/0#"; //星系
var ob1 = "#fEffect/SetEff/102/effect/7#";//PPMS鸟右
var ob2 = "#fEffect/SetEff/102/effect/7#";//PPMS鸟左
var F114 = "#fUI/NameTag.img/157/w#";//小兔子戒指头部、
var ob14 = "#fUI/UIWindow2.img/Item/timeLimit/0#";//小闹钟
var F118 = "#fUI/UIWindow4.img/bossArena/mainUi/bossIcon/0#";//迷你女皇
var F119 = "#fUI/UIWindow4.img/bossArena/mainUi/bossIcon/1#";//迷你女皇
var F120 = "#fUI/UIWindow4.img/bossArena/mainUi/bossIcon/2#";//迷你女皇
var F121 = "#fUI/UIWindow4.img/bossArena/mainUi/bossIcon/3#";//迷你女皇
var F122 = "#fUI/UIWindow4.img/bossArena/mainUi/bossIcon/4#";//迷你女皇
var 笑脸 = "#fEtc/ItemPotLifeInfo/1000/state/good/0#";
var 睡脸 = "#fEtc/ItemPotLifeInfo/1000/state/sleep/0#";
var 愁脸 = "#fEtc/ItemPotLifeInfo/1000/state/sick/0#";
var ob6 = "#fEffect/SetEff.img/181/effect/walk1/2#";//狗拉车
var ob5 = "#fEffect/OnUserEff.img/PL_RocketEgg/clear/3#";//火箭人
function start() {
    a = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 1)
            a++;
        else
            a--;
        if (a == -1) {
            cm.dispose();
        } else if (a == 0) {
            cm.sendSimple(ob5+"#v1702655##v1702656##v1702657##v1702665##v1702666##v1702667#\r\n 欢迎来到" +  cm.getServerName()+ "点卷商城本服赞助比例:1元=1000点卷"+"#b#n\r\n\r\n#L0# "+笑脸+"#r#e帽子系列#l#L1# "+笑脸+"脸饰系列#L2# "+笑脸+"眼饰系列\r\n\r\n#L3# "+笑脸+"耳环系列#L4# "+笑脸+"手套系列#L5# "+笑脸+"上装系列\r\n\r\n#L6# "+笑脸+"下装系列#L7# "+笑脸+"鞋子系列#L8# "+笑脸+"披风系列\r\n ")
        } else if (a == 1) {
            if (selection == 0){
                cm.dispose();
                cm.openNpc(9270096,"魔方商城");
            }else if (selection == 1) {//防具商店
                cm.dispose();
                cm.openNpc(9270096,"怪怪魔方");
            } else if (selection == 2) {//稀有点装
                cm.dispose();
                cm.openNpc(9270096,"点装列表");
            } else if (selection == 3) {//武器商店
                cm.dispose();
                cm.openNpc(9270096,"绝版点装戒指");
            } else if (selection == 4) {//武器商店
                cm.dispose();
                cm.openNpc(9270096,"呆萌宠物");
            } else if (selection == 5) {//武器商店
                cm.dispose();
                cm.openNpc(9270096,"超神卷轴");
            } else if (selection == 6) {//副手
                cm.dispose();
                cm.openNpc(9270096,"抽奖转蛋");
            } else if (selection == 7) {//武器商店
			    cm.dispose();
                cm.openNpc(9270096,"稀有材料");
            } else if (selection == 8) {//RED
			    cm.dispose();
                cm.openNpc(9270096,"喇叭道具");
            } else if (selection == 9) {//运动币
                cm.openShop(74);
			} else if (selection == 22) {//勋章商店boss商店
		        cm.openShop(40);
			} else if (selection ==23) {//星岩
                cm.openShop(401);
		    } else if (selection ==887) {//灵魂宝珠
                cm.openShop(326);
			 } else if (selection ==889) {//安卓商店
                cm.openShop(310);
			 } else if (selection == 10) {//返回
                cm.openNpc(9010000);
            } else {
                // 1012123 杂货商店 x
                //10 低级防具
                //11 50~60级防具
                //12 60~70级防具
                //20 低级武器
                //21 50~60级武器
                //22 60~70级武器
                // 3 其他道具 
                // 4 卷轴商店 x 
                // 1012125 宠物商店
                // 6 辅助武器
                cm.openShop(selection);
                cm.dispose();
            }
        } else if (a == 2) {
            switch (selection) {
                case 0://低级防具
                    //cm.openShop(10)
                    cm.sendOk("暂时未开放。")
                    break;
                case 1://50~60级防具
                    cm.openShop(11)
                    break;
                case 2://60~70级防具
                    cm.openShop(12)
                    break;
                case 3://低级武器
                    //cm.openShop(20)
                    cm.sendOk("暂时未开放。")
                    break;
                case 4://50~60级武器
                    cm.openShop(21)
                    break;
                case 5://60~70级武器
                    cm.openShop(22)
                    break;
            }
            cm.dispose();
        }//a
    }//mode
}//f